import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/Login";
import User from "@/views/User";
import Index from "@/views/Index";
import Role from "@/views/Role";
import Room from "@/views/Room";
import Menu from "@/views/menu/Menu";
import Community from "@/views/Community";
import Dictionary from "@/views/Dictionary";
import Unit from "@/views/Unit";

import Visitor from "@/views/Visitor";
import Dept from "@/views/dept/Dept";
import Personal from "@/views/personal/Personal";
import DictionaryData from "@/views/DictionaryData";
import Post from "@/views/Post";
import OperationLog from "@/views/OperationLog";
import OwnerRoom from "@/views/OwnerRoom";

import Building from "@/views/Building";
import LoginLog from "@/views/LoginLog";

import Welcome from "@/views/Welcome";
import Suggest from "@/views/Suggest";
import Repair from "@/views/Repair";
import CommunityInteraction from "@/views/CommunityInteraction";
import Owner from "@/views/Owner";
Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: '登录',
        component: Login
    },
    {
        path: '/index',
        name: '主页',
        component: Index,
        redirect: '/welcome',
        meta: {
            title: "智慧社区"
        },
        children: [
            {
                path: '/welcome',
                name: '欢迎页',
                component: Welcome,
                meta: {
                    title: "欢迎页"
                }
            },
            {
                path: '/user',
                name: 'User',
                component: User,
                meta: {
                    title: "用户管理"
                }

            },
            {
                path: '/room',
                name: 'Room',
                component: Room,
                meta: {
                    title: "房屋信息"
                }

            },
            {
                path: '/role',
                name: 'Role',
                component: Role,
                meta: {
                    title: "角色管理"
                },
            },
            {
                path: '/menu',
                name: 'Menu',
                component: Menu,
                meta: {
                    title: "菜单管理"
                }
            },
            {
                path: '/community',
                name: 'Community',
                component: Community,
                meta: {
                    title: "小区信息"
                }
            },
            {
                path: '/dict',
                name: 'dictionary',
                component: Dictionary,
                meta: {
                    title: "字典管理"
                }
            }, {
                path: '/dept',
                name: 'Dept',
                component: Dept,
                meta: {
                    title: "部门管理"
                }
            }, {
                path: '/dictData/:dictType',
                name: 'dictData',
            },
            {
                path: '/personal',
                name: 'personal',
                component: Personal,
                meta: {
                    title: "个人中心"
                }
            }, {
                path: '/dictData',
                name: 'dictionaryData',
                component: DictionaryData,
                meta: {
                    title: "字典数据"
                }
            }, {
                path: '/post',
                name: 'post',
                component: Post,
                meta: {
                    title: "岗位管理"
                }
            },
            {
                path: '/visitor',
                name: 'Visitor',
                component: Visitor,
                meta: {
                    title: "访客邀请"
                }
            },
            {
                path: '/building',
                name: 'Building',
                component: Building,
                meta: {
                    title: "楼栋信息"
                }
            },
            {
                path: '/logininfor',
                name: 'LoginLog',
                component: LoginLog,
                meta: {
                    title: "登录日志"
                }
            },
            {
                path: '/operlog',
                name: 'OperationLog',
                component: OperationLog,
                meta: {
                    title: "操作日志"
                }
            },
            {
                path: '/suggest',
                name: 'Suggest',
                component: Suggest,
                meta: {
                    title: "投诉建议"
                }
            },
            {
                path: '/repair',
                name: '报修信息',
                component: Repair,
                meta: {
                    title: "报修信息"
                }
            },
            {
                path: '/ownerRoom',
                name: 'OwnerRoom',
                component: OwnerRoom,
                meta: {
                    title: "业主审核"
                }
            },
            {
                path: '/unit',
                name: 'Unit',
                component: Unit,
                meta: {
                    title: "单元信息"
                }

            },
            {
                path: '/interaction',
                name: 'CommunityInteraction',
                component: CommunityInteraction,
                meta: {
                    title: "互动管理"
                }
            },
            {
                path: '/owner',
                name: 'Owner',
                component: Owner,
                meta: {
                    title: "业主信息"
                }
            },
        ]
    }
]

const router = new VueRouter({
    routes
})

export default router
